using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EVEChat
{
    public partial class Error : Form
    {
        string action;

        public Error(string errorMessage, string buttonAction)
        {
            InitializeComponent();
            errorText.Text = errorMessage;
            action = buttonAction;

            switch (buttonAction)
            {
                case "openSettings":
                    theButton.Text = "Settings";
                    theButton.Click += new System.EventHandler(this.theButtonAction);
                    break;

                default:
                    theButton.Text = "OK";
                    theButton.Click += new System.EventHandler(this.theButtonAction);
                    break;
            }
        }

        public void theButtonAction(object sender, EventArgs e)
        {
            switch (action)
            {
                case "openSettings":
                    Settings settingsBox = new Settings();
                    settingsBox.ShowDialog();
                    this.Close();
                    break;

                default:
                    this.Close();
                    break;
            }
        }
    }
}